import java.util.Scanner;

public class HelloWord {
    public static void main(String[] args) {
        Scanner stdIn=new Scanner(System.in);
        int a;
        double data,f;
        while (true) {
            System.out.println("放入一个实数：");
            data = stdIn.nextDouble();//从键盘读入一个数
            a = (int) data;//强制类型转换例如4.6转换成4，此时的4是a
            f = data - a;
            a=(f<0.5)?a:a+1;

            /*if (f < 0.5)
                System.out.println("四舍之后的整数：" + a + "。");
            else
                System.out.println("五入之后的整数：" + (a + 1) + "。");*/
        }
    }
}
